package com.uzhie.web.service;

import com.uzhie.web.dao.OrderDAO;
import com.uzhie.jt808.jt1078.entity.JT_8103;
import com.uzhie.jt808.service.JT808ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;

/**
 * Created by zhangdequan on 2018/8/13.
 */
@Service
public class JT8103Service {

    @Autowired(required = false)
    private JT808ServiceImpl jt808Service;

    @Autowired
    private OrderDAO orderDAO;


    /**
     * 1078参数定义,设置命令下发
     * @param id
     * @param vehicleNumber
     * @param jt_8103
     * @return
     */
    public String  terminalPause(int id,String vehicleNumber,JT_8103 jt_8103){
        System.err.print("测试指令下发-----------"+ Arrays.toString(jt_8103.WriteToBytes()));
        boolean result = jt808Service.post(id, vehicleNumber, jt_8103.WriteToBytes());
        if (result){
            return "指令下发成功";
        }else{
            return "指令下发失败";
        }
    }
}
